<template>
  <div class="organizationInfo">
    <div class="title">审核</div>
    <div class="line"></div>
    <div class="orgInfos">
      <div class="orgInfo">
        <div>
          <p>机构名称：<span style="margin-left:75px;">{{orgInfo.name}}</span></p>
          <p>负责人姓名：<span style="margin-left:60px;">{{orgInfo.major}}</span></p>
          
        </div>
        <div>
          <p class="logo">机构logo：<img :src="orgInfo.logo" alt="" ></p>
        </div>
      </div>
      <p>负责人联系方式：<span style="margin-left:32px;">{{orgInfo.major_phone}}</span></p>
      <p>邮箱：<span style="margin-left:100px;">{{orgInfo.email}}</span></p>
      <p class="info">
        <span style="width: 72px">机构简介：</span>
        <el-input rows="7" style="width: 450px;" type="textarea" v-model="orgInfo.info"></el-input>
      </p>
      <p class="prove">资质证明：<img :src="orgInfo.prove" alt="" style="margin-left:73px;"></p>
      <!-- <div class="orgInfo">
        <div>
          <p>机构名称：<span>{{orgInfo.name}}</span></p>
          <p>负责人姓名：<span>{{orgInfo.major}}</span></p>
        </div>
        <div>
          <p class="logo">机构logo：<img :src="orgInfo.logo" alt=""></p>
        </div>
      </div>
      <p>负责人联系方式：<span>{{orgInfo.major_phone}}</span></p>
      <p>邮箱：<span>{{orgInfo.email}}</span></p>
      <p class="info">
        <span style="width: 72px">机构简介：</span>
        <el-input autosize style="width: 504px;" type="textarea" v-model="orgInfo.info"></el-input>
      </p>
      <p class="prove">资质证明：<img :src="orgInfo.prove" alt=""></p> -->
      <p class="prove">驳回理由：<el-input v-model="rejected" placeholder="请输入驳回理由，通过则无需输入" autosize style="width: 450px; margin-left:75px" type="textarea"></el-input></p>
      <p class="prove password">登陆密码：<el-input placeholder="请输入密码" v-model="pwd" style="width: 450px; margin-left:75px" type='password'></el-input></p>
    </div>
    <div class="line" style="margin-left: 70px"></div>
    <div style="text-align: center;margin-bottom: 40px;">
      <el-button type="primary" @click="operation(1)">通过</el-button>
      <el-button type="warning" @click="operation(2)">驳回</el-button>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      pwd:'',
      orgInfo: '',
      rejected:'',
			user_id:''
    }
  },
  created() {
    this.getClubInfo()
  },
  methods: {
    getClubInfo() {
      this.$axios.post('/UserManage/club_info', {
          id: this.$route.query.organizationId,
        }, {
          headers: {
            token: window.sessionStorage.getItem('token')
          }
        })
        .then(res => {
          if (res.data.code == 2000) {
            this.orgInfo = res.data.data
						this.user_id = res.data.data.user_id
          }
        })
        .catch(error => {
          console.log(error)
        });
    },
    operation(status) {
      this.$axios.post('/UserManage/audit_user', {
        type:2,
        status:status,
        rejected:this.rejected,
        user_id: this.user_id,
        password:this.pwd
        }, {
          headers: {
            token: window.sessionStorage.getItem('token')
          }
        })
        .then(res => {
          if (res.data.code == 2000) {
						this.$message({
							type: 'success',
							message: res.data.msg
						})
            this.$router.go(-1)
            // this.orgInfo = res.data.data
          }else{
            this.$message({
            	type: 'error',
            	message: res.data.msg
            })
          }
        })
        .catch(error => {
          console.log(error)
        });
    },
  }
}

</script>
<style lang="less" scoped>

// .prove{
//   display: flex;
//   img{
//     display: inline-block;
//     width: 336px;
//     height: 215px;
//     border: 1px #ccc solid;
//     padding: 20px 30px;
//     border-radius: 4px;
//   }
//   el-input{
//     width: 300px;
//     border: 1px solid red;
//   }
// }
// .info{
//   display: flex;
//   /*justify-content: space-between;*/
//   textarea{
//     height: 100%;
//   }
// }
// .orgInfos .logo {
//   display: flex;
//   margin-bottom: 0;
//   img {
//     display: inline-block;
//     width: 88px;
//     height: 88px;
//     border: 1px #ccc solid;
//     padding: 10px;
//     border-radius: 4px;
//   }
// }

// .title {
//   margin-left: 26px;
//   margin-bottom: 12px;
//   margin-top: 12px;
//   font-weight: bold;
// }

// .line {
//   width: 80%;
//   border-top: 1px #dcdfe6 dotted
// }

// .orgInfos {
//   margin-top: 31px;
//   margin-left: 70px;
//   width: 50%;
//   p {
//     margin-bottom: 34px;
//   }
//   .orgInfo {
//     display: flex;
//     justify-content: space-between;
//   }
// }











.organizationInfo{
  padding-bottom: 200px;
}
.avatar-uploader{
   img {
    display: inline-block;
    border: 1px #ccc solid;
    padding: 10px;
    border-radius: 4px;
  }
}
.prove{
  display: flex;
  img{
    display: inline-block;
    width: 390px;
    border: 1px #ccc solid;
    padding: 20px 30px;
    border-radius: 4px;
  }
}
.info{
  display: flex;
  /*justify-content: space-between;*/
  span{
    margin-right: 70px;
  }
  textarea{
    height: 100%;
  }
}
.orgInfos input{
  border: none;
  outline: none;
}
.orgInfos .logo {
  display: flex;
  margin-bottom: 0;
  img {
    display: inline-block;
    width: 88px;
    height: 88px;
    border: 1px #ccc solid;
    padding: 10px;
    border-radius: 4px;
  }
}
.el-textarea textarea.el-textarea__inner{
  width: 414px !important;
}
.title {
  margin-left: 26px;
  margin-bottom: 12px;
  margin-top: 12px;
  font-weight: bold;
}

.line {
  width: 80%;
  border-top: 1px #dcdfe6 dotted
}

.orgInfos {
  margin-top: 31px;
  margin-left: 70px;
  width: 50%;
  p {
    margin-bottom: 34px;
  }
  .orgInfo {
    display: flex;
    justify-content: space-between;
  }
}
.prove.password::before{
  content: "*";
  margin-left:-5px;
  line-height: 25px;
  color: red;
}
</style>
